package gbench.sandbox.record;
import org.junit.jupiter.api.Test;

import gbench.common.fs.XlsFile.DataMatrix;
import static gbench.common.tree.LittleTree.IRecord.*;
import static gbench.common.tree.LittleTree.*;
import static gbench.common.fs.XlsFile.DataMatrix.*;
public class JunitArray {
    
    @Test
    public void foo() {
        var aa = A(1,2,3,4);// 整形数组，相当于 new Integer[](1,2,3,4,5);
        var aaa = RPTA(1,aa);
        System.out.println(fmt(aaa));
    }
    
    @Test
    public void bar() {
        var aa = A(1,2,3,4);// 整形数组，相当于 new Integer[](1,2,3,4,5);
        var aaa = RPTA(5,aa);
        System.out.println(fmt(aaa));
    }
    
    /**
     * 列连接
     */
    @Test
    public void qux() {
        var aaa = DataMatrix.transpose(RPTA(1,A(1,2,3,4)));// 构造了一个列向量
        var bbb = DataMatrix.transpose(RPTA(1,A(5,6,7,8)));// 构造了一个列向量
        System.out.println(fmt(aaa));
        System.out.println(fmt(cbind(aaa,bbb)));
    }
    
    /**
     * 行连接
     */
    @Test
    public void qux2() {
        var aaa = RPTA(1,A(1,2,3,4));// 构造了一个列向量
        var bbb = RPTA(1,A(5,6,7,8));// 构造了一个列向量
        System.out.println(fmt(aaa));
        System.out.println(fmt(rbind(aaa,bbb)));
    }
    
    /**
     * 行连接
     */
    @Test
    public void qux3() {
        var aaa = RPTA(1,A(1,2,3,4));// 构造了一个列向量
        var bbb = RPTA(1,A(5,6,7,8));// 构造了一个列向量
        System.out.println(fmt(aaa));
        var ccc = rbind(rbind(aaa,bbb),RPTA(1,A(1,2)));
        ccc = rbind(ccc,RPTA(1,A(1)));
        System.out.println(fmt(ccc));
    }

}
